Xbasic

RTF.SHOW_CODES Function

Syntax

.SHOW_CODES()

Description

The .SHOW_CODES() method toggles the display of formatting codes on and off.

Example

dim crtf.text as C
dim num as N = 1
dim name as C
dim first_left_indent as N
dim left_indent as N
dim right_indent as N
crtf.object = rtf.create(" ")
crtf.object.insert("RTF Text to stretch over one line." + crlf()+ "So you can see what full justify does", 1)
crtf.text = crtf.object.rtf_text
ui_dlg_box("Xdialog Sample", <<%dlg%
{xmargin=2}
|{rtf=30,10crtf};
{lf};
Style;
Number |[.5num];
Name |[.25name];
First Indent |[.10first_left_indent];
Left Indent |[.10left_indent];
Right Indent |[.10right_indent];
{lf};
|;
|;
%dlg%,<<%code%
if a_dlg_button="Set_Style" then
    crtf.object.style[num].name = name
    crtf.object.style[num].first_left_indent = first_left_indent
    crtf.object.style[num].left_indent = left_indent
    crtf.object.style[num].right_indent = right_indent
    a_dlg_button = ""
end if
if a_dlg_button="Get_Style" then
    crtf.object.Get_style(num)
    name = crtf.object.style[num].name
    first_left_indent = crtf.object.style[num].first_left_indent
    left_indent = crtf.object.style[num].left_indent
    right_indent = crtf.object.style[num].right_indent
    a_dlg_button = ""
end if
if a_dlg_button = "Left" then
crtf.object.left_justify()
    a_dlg_button = ""
end if
if a_dlg_button = "Right" then
crtf.object.right_justify()
    a_dlg_button = ""
end if
if a_dlg_button = "Toggle_Codes" then
crtf.object.show_codes()
    a_dlg_button = ""
end if
%code%)

Limitations

Desktop applications only.

See Also